import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SystemInfoConfigVO, SystemInfoConfigForm, SystemInfoConfigQuery } from '@/api/application/systemInfoConfig/types';

/**
 * 查询系统信息配置列表
 * @param query
 * @returns {*}
 */

export const listSystemInfoConfig = (query?: SystemInfoConfigQuery): AxiosPromise<SystemInfoConfigVO[]> => {
  return request({
    url: '/application/systemInfoConfig/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询系统信息配置详细
 * @param id
 */
export const getSystemInfoConfig = (id: string | number): AxiosPromise<SystemInfoConfigVO> => {
  return request({
    url: '/application/systemInfoConfig/' + id,
    method: 'get'
  });
};

/**
 * 新增系统信息配置
 * @param data
 */
export const addSystemInfoConfig = (data: SystemInfoConfigForm) => {
  return request({
    url: '/application/systemInfoConfig',
    method: 'post',
    data: data
  });
};

/**
 * 修改系统信息配置
 * @param data
 */
export const updateSystemInfoConfig = (data: SystemInfoConfigForm) => {
  return request({
    url: '/application/systemInfoConfig',
    method: 'put',
    data: data
  });
};

/**
 * 删除系统信息配置
 * @param id
 */
export const delSystemInfoConfig = (id: string | number | Array<string | number>) => {
  return request({
    url: '/application/systemInfoConfig/' + id,
    method: 'delete'
  });
};
